package com.haredot.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serial;

public class PermissionGrantedAuthority implements GrantedAuthority {
    @Serial
    private static final long serialVersionUID = 7815896837405220934L;
    /**
     * 权限节点ID
     */
    private Long id ;

    /**
     * 权限级别 (1 系统 2 菜单 3 功能  4 按钮)
     */
    private Integer level ;

    /**
     * 权限名字
     */
    private String name ;

    /**
     * 功能对应的 链接地址
     */
    private String url ;

    /**
     * 权限标识
     */
    private String remark ;

    /**
     * 菜单图标
     */
    private String icon ;
    /**
     * 上级ID
     */
    private Long pid ;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @JsonIgnore
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String getAuthority() {
        return remark;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Long getPid() {
        return pid;
    }

    public void setPid(Long pid) {
        this.pid = pid;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }
}
